package com.sooncode.project.focusservice.model.VO;

import com.sooncode.project.sooncodeutils.utils.SecurityUtils;

public class Password extends com.sooncode.project.core.model.ValueObject<String> {
    private String password;
    public Password(String password){
        setPassword(password);
    }
    public static String encrypt(String password){
        return SecurityUtils.encryptPassword(password);
    }
    public boolean matches(String password){
        if(SecurityUtils.matchesPassword(password,this.password)){
            return true;
        }
        return false;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Override
    public String getValue() {
        return password;
    }
}
